home *** CD-ROM | disk | FTP | other *** search
- /**********************************************************************\
-
- File: Halves scroll.c
-
- Purpose: This module handles clearing the screen in a funky
- manner. See the comments below for more details.
-
-
- Shutdown FX -=- graphic effects on shutdown
- Copyright (C) 1993 Mark Pilgrim & Dave Blumenthal
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program in a file named "GNU General Public License".
- If not, write to the Free Software Foundation, 675 Mass Ave,
- Cambridge, MA 02139, USA.
-
- \**********************************************************************/
-
- #include "msg timing.h"
-
- #define BoxSize 10
- #define CorrectTime 3
-
- void HalvesScroll(GrafPtr thePtr, Pattern *thePattern, int width, int height);
-
- /* 2 regions, split down the middle of the screen. Scroll the screen up in one
- region and down in the other. */
-
- void HalvesScroll(GrafPtr thePtr, Pattern *thePattern, int width, int height)
- {
- int x;
- Rect topdest, bottomdest;
- Rect topscrollsource, topscrolldest;
- Rect bottomscrollsource, bottomscrolldest;
- int cx;
-
- cx = width / 2;
-
- SetRect(&topscrollsource, 0, 0, cx, height-BoxSize);
- topscrollsource.right=cx;
- topscrolldest = topscrollsource;
- OffsetRect(&topscrolldest, 0, BoxSize);
-
- SetRect(&topdest, 0, 0, cx, BoxSize);
-
- SetRect(&bottomscrollsource, cx, BoxSize, width, height);
- bottomscrolldest=bottomscrollsource;
- OffsetRect(&bottomscrolldest, 0, -BoxSize);
-
- SetRect(&bottomdest, cx, height-BoxSize, width, height);
-
- for(x = height - BoxSize; x >= 0; x -= BoxSize)
- {
- StartTiming();
- CopyBits(&(thePtr->portBits), &(thePtr->portBits),
- &topscrollsource, &topscrolldest, 0, 0L);
- FillRect(&topdest, *thePattern);
-
- CopyBits(&(thePtr->portBits), &(thePtr->portBits),
- &bottomscrollsource, &bottomscrolldest, 0, 0L);
- FillRect(&bottomdest, *thePattern);
-
- TimeCorrection(CorrectTime);
- }
- }
-